import navBar from '@/components/navBar'

// export default {
//   install: function (Vue) {
//     Vue.component('navBar', navBar)
//   }
// }
import moment from 'moment'
export default function (Vue) {
  Vue.prototype.$baseUrl = process.env.VUE_APP_URL
  Vue.component('navBar', navBar)
  Vue.filter('formatTime', function (time) {
    const _time = moment(time)
    const _localTime = moment()
    const _diff = _localTime.diff(_time, 'h')
    if (_diff < 1) {
      return '刚刚'
    } else if (_diff < 24) {
      return _diff + '小时前'
    } else {
      return _time.format('YYYY/MM/DD HH:mm:ss')
    }
  })
}
